1. Technical Field
The present invention relates to software engineering and more particularly, to code refactoring applied on the code level.
2. Discussion of the Related Art
As software systems evolve, their architecture becomes more and more complicated and difficult to understand and evolve. There are multiple tools that support visualization of software systems and allow simulating architectural improvements to the system, often by using visual representations.
Currently available code visualization and refactoring tools allow detecting anti-patterns in the code and additional violations of the original architecture. Once the violations are detected, the user may wish to eliminate those dependencies. This can be often achieved by moving software elements from one software component to another. Several tools that allow removing some types of undesired relations by changing the location of a specific software element or a component are already known in the art. However, the scope of the analysis and the manipulation that those tools support is not fine-grained enough. Those tools can only move low level elements such as fields and methods from high level elements such as classes, packages, and the like.
One of the drawbacks of currently available tools is that they cannot modify methods or other low level elements to reflect specific types of architectural modifications the user may wish to perform. For example, a specified system exhibits a dependency of a component A on a component B. This dependency exists due to a specified method in A that accesses code in B. The user may wish to remove this dependency and introduce a new component C such that only C depends on B and A depends on C. This may require moving part of the specified method in A to a new method in C.